package com.article.service.impl;

import com.article.dao.ArticleTypeDao;
import com.article.dao.MenuInfoDao;
import com.article.model.ArticleType;
import com.article.model.MenuInfo;
import com.article.service.MenuInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/5/2.
 */
@Service("menuInfoService")
public class MenuInfoServiceImpl implements MenuInfoService {
    @Autowired
    private MenuInfoDao menuInfoDao;

    public Long countTotal(Map<String, Object> map) {
        return menuInfoDao.countTotal(map);
    }

    public PageInfo<MenuInfo> listByPage(Integer pageIndex, Integer limit, Map<String, Object> map) {
        PageHelper.startPage(pageIndex, limit);
        List<MenuInfo> menuInfoList = menuInfoDao.listByPage(map);
        return new PageInfo<MenuInfo>(menuInfoList);
    }

    public List<MenuInfo> listByMap(Map<String, Object> map) {
        return menuInfoDao.listByMap(map);
    }

    public MenuInfo getById(Long id) {
        return menuInfoDao.getById(id);
    }

    public MenuInfo getByMap(Map<String, Object> map) {
        return menuInfoDao.getByMap(map);
    }
}
